package com.cm.stock.manager.dto;

import java.io.Serializable;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;


@SuppressWarnings("serial")
@Entity
@Table(name = "articlefacture")
public class ArticleFactureDTO implements Serializable{

		@Id
		@Column(name = "ID", nullable = false)
		@GeneratedValue(strategy = GenerationType.AUTO)
		private int id;
		@ManyToOne(fetch = FetchType.EAGER)
		@JoinColumn(name = "facture_Id",nullable=false)
		private FactureDTO facture;
		@ManyToOne(fetch = FetchType.EAGER)
		@JoinColumn(name = "article_Id",nullable=false)		
		private ArticleDTO article;
		private int quantite;
		private double prixUnitaire;
		public int getId() {
			return id;
		}
		public void setId(int id) {
			this.id = id;
		}
		public FactureDTO getFacture() {
			return facture;
		}
		public void setFacture(FactureDTO facture) {
			this.facture = facture;
		}
		public ArticleDTO getArticle() {
			return article;
		}
		public void setArticle(ArticleDTO article) {
			this.article = article;
		}
		public int getQuantite() {
			return quantite;
		}
		public void setQuantite(int quantite) {
			this.quantite = quantite;
		}
		public double getPrixUnitaire() {
			return prixUnitaire;
		}
		public void setPrixUnitaire(double prixUnitaire) {
			this.prixUnitaire = prixUnitaire;
		}
		public ArticleFactureDTO(FactureDTO facture, ArticleDTO article,
				int quantite, double prixUnitaire) {
			super();
			this.facture = facture;
			this.article = article;
			this.quantite = quantite;
			this.prixUnitaire = prixUnitaire;
		}
		public ArticleFactureDTO() {
			super();
		}

		
}
